package com.bwie.task;

import com.bwie.mapper.ProdMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
public class ProdTask {
    @Autowired
    ProdMapper prodMapper;

    //@Scheduled(cron = "0 0/1 * * * ?")
    public void uploadProdTask(){
        System.out.println("开始执行上架任务");
        prodMapper.taskUploadProd();
        System.out.println("结束执行定时上架任务");
    }

    //@Scheduled(cron = "0 */1 * * * ?")
    public void downloadProdTask(){
        System.out.println("开始执行下架任务");
        prodMapper.taskDpwnLoadProd();
        System.out.println("结束执行定时下架任务");
    }
}
